<template>
  <div class="common-head">
    <van-nav-bar
      :title="title"
      left-arrow
      :style="{background:bg}"
      @click-left="goBack"
    />
  </div>
</template>

<script>
export default {
  props: {
    title: {
      type: String,
      required: true
    },
    bg: {
      type: String,
      default: '#f66'
    }
  },
  methods: {
    goBack () {
      this.$router.go(-1)
    }
  }
}
</script>

<style lang="scss" scoped>
.common-head{
  position: fixed;
  top:0;
  left:0;
  width:100%;
  z-index: 10;
}

.common-head /deep/ .van-nav-bar .van-nav-bar__title{
  color:#f1f1f1;
}
.common-head /deep/ .van-nav-bar  .van-icon{
  font-size: 24px;
  color:#f1f1f1;
}
</style>
